package com.example.hi;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class Show2Activity extends AppCompatActivity implements View.OnClickListener {
    TextView textView_name,textView_value_rate;
    EditText editText;
    String value;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_show);
        Intent intent=getIntent();
        String name=intent.getStringExtra("name");
        value=intent.getStringExtra("value");


        textView_name=findViewById(R.id.name_country);
        editText=findViewById(R.id.edittext);
        textView_value_rate=findViewById(R.id.show);

        textView_name.setText(name);


    }

    @Override
    public void onClick(View v) {
        float rate= Float.valueOf(value);
        String input=editText.getText().toString();
        textView_value_rate.setText(""+Float.valueOf(input)*100/rate);

    }
}
